home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
ctlib100.zip
/
INSTALL.LZH
/
CTFIELDS.INT
< prev
next >
Wrap
Text File
|
1996-10-12
|
4KB
|
113 lines
{**************************************************************************}
{* BitSoft Development, L.L.C. *}
{* Copyright (C) 1995, 1996 BitSoft Development, L.L.C. *}
{* All rights reserved. *}
{* Field types unit *}
{* Version 1.2.2 *}
{**************************************************************************}
unit ctFields;
{$X+}
interface
uses Objects,
ctTypes, ctCollec;
type
FieldTypes = (ftUnknown, ftChar, ftString, ftPChar, ftMemo,
ftBoolean, ftDate, ftTime,
ftByte, ftWord, ftShortInt, ftInteger, ftLongInt, ftComp,
ftReal, ftSingle, ftDouble, ftExtended,
ftPString, ftPointer,
ftRecord, ftObject, ftObjectID);
type
PField = ^TField;
TField = object(TObject)
Name : PFieldName;
FieldType : FieldTypes;
Length : Word;
Decimals : Byte;
constructor Init (AName : TFieldName; AFieldType : FieldTypes;
ALength : Word; NumberOfDecimals : Byte);
constructor Load (var S : TStream);
destructor Done; virtual;
function Copy : PField; virtual;
function Size : Word; virtual;
procedure Store (var S : TStream); virtual;
end; { TField }
type
PFieldStructure = ^TFieldStructure;
TFieldStructure = object(TCollection)
function Copy : PFieldStructure; virtual;
function FieldDecimals (AField : Integer) : Byte;
function FieldLength (AField : Integer) : Word;
function FieldName (AField : Integer) : PFieldName;
function FieldType (AField : Integer) : FieldTypes;
function Length : LongInt; virtual;
procedure ShowInfo (var Device : Text); virtual;
function Size : Word; virtual;
end; { TFieldStructure }
function NewObjectField (Name : TFieldName; ObjectSize : Word) : PField;
function NewObjectIDField : PField;
function NewCharField (Name : TFieldName) : PField;
function NewStringField (Name : TFieldName; MaxLen : Byte) : PField;
function NewPCharField (Name : TFieldName; MaxLen : Word) : PField;
function NewPStringField (Name : TFieldName; MaxLen : Word) : PField;
function NewBooleanField (Name : TFieldName) : PField;
function NewDateField (Name : TFieldName) : PField;
function NewPointerField (Name : TFieldName) : PField;
function NewTimeField (Name : TFieldName) : PField;
function NewByteField (Name : TFieldName) : PField;
function NewShortIntField (Name : TFieldName) : PField;
function NewWordField (Name : TFieldName) : PField;
function NewIntegerField (Name : TFieldName) : PField;
function NewLongIntField (Name : TFieldName) : PField;
function NewCompField (Name : TFieldName) : PField;
function NewRealField (Name : TFieldName) : PField;
function NewSingleField (Name : TFieldName) : PField;
function NewDoubleField (Name : TFieldName) : PField;
function NewExtendedField (Name : TFieldName) : PField;
procedure RegisterFields;
const
RField : TStreamRec = (
ObjType : idField;
VmtLink : Ofs(TypeOf(TField)^);
Load : @TField.Load;
Store : @TField.Store);
RFieldStructure : TStreamRec = (
ObjType : idFieldStructure;
VmtLink : Ofs(TypeOf(TFieldStructure)^);
Load : @TFieldStructure.Load;
Store : @TFieldStructure.Store);
implementation
end.